<template>
  <div>
    <nav-bar title="巡检记录"></nav-bar>
    <div class="fixedInspection maxinBox" v-if="inspectionList.length">
      <div class="titleModel">{{inspectionList[0].patrolPointName}}</div>
      <van-row class="inspection backgroundfff" v-for="(item, index) in inspectionList" :key="index">
        <van-col :span="12">
          <div>
            <span>{{item.planName}}</span>
            <van-button class="floatRight" round plain type="info" size="mini" v-if="item.result">正常</van-button>
            <van-button class="floatRight" round plain type="danger" size="mini" v-else>异常</van-button>
          </div>
          <div class="fontSize14 color999">
            {{item.name}}
          </div>
        </van-col>
        <van-col :span="12" class="right">
          <span class="color999">{{item.execTime | formatDate}}</span>
        </van-col>
      </van-row>
    </div>
  </div>
</template>

<script>
  import fixedInspectionApi from '../../../../api/workAPI/fixedInspectionAPI.js'
  export default {
    data() {
      return {
        inspectionList: []
      }
    },
    methods:{
      // 巡检记录列表
      getWatchmanList() {
        fixedInspectionApi.getWatchmanList(JSON.parse(localStorage.getItem('pointDetails')).patrolPointId).then(res => {
          this.inspectionList = res
        })
      }
    },
    mounted() {
      this.getWatchmanList()
    }
  }
</script>
